/**
*  \file kwp_rc.h
*
*  \brief   KWP2000 respones codes.
*
*  \author  Michael J. Hohmann <michael.hohmann@linde-mh.de>
*
*/

#ifndef KWP_RC_H_INCLUDED
#define KWP_RC_H_INCLUDED

#ifndef KWP_RC_LINKAGE
#define KWP_RC_LINKAGE extern
#endif

/*================================================[ public includes  ]================================================*/
#include "../cfg/prj.h"

/*================================================[ public defines   ]================================================*/

/*================================================[ public datatypes ]================================================*/
/** Standard KWP2000 error codes */
enum kwp_response_code
{
   KWP_RESPONSE_CODE_GENERALREJECT                    = 0x10,
   KWP_RESPONSE_CODE_SERVICENOTSUPPORTED              = 0x11,
   KWP_RESPONSE_CODE_SUBFUNCTIONNOTSUPPORTED          = 0x12,
   KWP_RESPONSE_CODE_INVALIDFORMAT                    = 0x12,
   KWP_RESPONSE_CODE_BUSYREPEATREQUEST                = 0x21,
   KWP_RESPONSE_CODE_CONDITIONSNOTCORRECT             = 0x22,
   KWP_RESPONSE_CODE_REQUESTSEQUENCEERROR             = 0x22,
   KWP_RESPONSE_CODE_ROUTINENOTCOMPLETED              = 0x23,
   KWP_RESPONSE_CODE_REQUESTOUTOFRANGE                = 0x31,
   KWP_RESPONSE_CODE_RESPONSEPENDING                  = 0x78,
   KWP_RESPONSE_CODE_SERVICENOTSUPPORTEDINACTIVEMODE  = 0x80,
   KWP_RESPONSE_CODE_ACCESSDENIED                     = 0x33,
   KWP_RESPONSE_CODE_INVALIDKEY                       = 0x35,
   KWP_RESPONSE_CODE_EXCEEDNUMOFATTEMPTS              = 0x36,
   KWP_RESPONSE_CODE_TIMEDELAYNOTEXPIRED              = 0x37,
   KWP_RESPONSE_CODE_DOWNLOADNOTACCEPTED              = 0x40,
   KWP_RESPONSE_CODE_IMPROPERDOWNLOADTYPE             = 0x41,
   KWP_RESPONSE_CODE_CANNTDOWNLOADTOADDRESS           = 0x42,
   KWP_RESPONSE_CODE_CANNTDOWNLOADNUMOFBYTES          = 0x43,
   KWP_RESPONSE_CODE_UPLOADNOTACCEPTED                = 0x50,
   KWP_RESPONSE_CODE_IMPROPERUPLOADTYPE               = 0x51,
   KWP_RESPONSE_CODE_CANNTUPLOADFROMADDRESS           = 0x52,
   KWP_RESPONSE_CODE_CANNTUPLOADNUMOFBYTES            = 0x53,
   KWP_RESPONSE_CODE_TRANSFERSUSPENDED                = 0x71,
   KWP_RESPONSE_CODE_TRANSFERABORTED                  = 0x72,
   KWP_RESPONSE_CODE_ILLEGALADDRESSINBLOCKTRANSFER    = 0x74,
   KWP_RESPONSE_CODE_ILLEGALBYTECOUNTINBLOCKTRANSFER  = 0x75,
   KWP_RESPONSE_CODE_ILLEGALBLOCKTRANSFERTYPE         = 0x76,
   KWP_RESPONSE_CODE_BLOCKTRANSFERDATACHECKSUMERROR   = 0x77,
   KWP_RESPONSE_CODE_INCORRECTBYTECNTDGBLOCKTRANSFER  = 0x79,
   KWP_RESPONSE_CODE_INVALIDCHECKSUM                  = 0xFB,
   /*
    * from here on there are proprietary return codes
    * that will be used for internal purposes and not
    * send on the can bus.
    */
   KWP_RESPONSE_CODE_NONE							  = 0xFE,
   KWP_RESPONSE_CODE_PENDING						  = 0xFD,
   KWP_RESPONSE_CODE_SUCCESS                          = 0xFF

};

/*================================================[ public variables ]================================================*/

/*================================================[ public functions ]================================================*/

/*====================================================================================================================*/

#endif
/***********************************************************************************************************************
*                             Copyright 2010 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/
